import { request } from '@/uni_modules/yq-request/js_sdk/index';

/**
 * 首页商品列表接口
 */
export const login = (data) => {
    return request({
        api: '/v4/user/login/4.0',
        method:'post',
        data,
	}); 
}

/**
 * 发送短信验证码接口
 */
export const sendSmsCode = (data) => {
    return request({
        api: '/v4/smsAuth/send',
        method: 'post',
        data,
	}); 
}

/**
 * 个人信息获取
 */
export const userHome = (data) => {
    return request({
        api: '/v4/user/home',
        method: 'get',
        data,
	}); 
}
	
/**
 * 修改个人信息
 */
export const updUserInfo = (data) => {
    return request({
        api: '/v4/newUser/updUserInfo',
        method: 'post',
        data,
	}); 
}	
	
/**
 * 修改年龄信息
 */
export const updUserBirth = (data) => {
    return request({
        api: '/v4/newUser/updUserBirth',
        method: 'post',
        data,
	}); 
}		

/**
 * 上传用户头像
 */
export const setAvatar = (data) => {
    return request({
        api: '/v4/user/setAvatar/4.0',
        method: 'post',
        data,
	}); 
}	

/**
 * 我的积分
 */
export const myIntegral = (data) => {
    return request({
        api: '/v4/userIntegral/myIntegral',
        method: 'post',
        data,
	}); 
}		

//积分记录
export const integralList = (data) => {
    return request({
        api: '/v4/userIntegral/integralList',
        method: 'post',
        data,
	}); 
}	

//查询可得到积分
export const getIntegral = (data) => {
    return request({
        api: '/v4/userIntegral/getIntegral',
        method: 'post',
        data,
	}); 
}	    

//首页轮播图
export const getBannerList = (data) => {
    return request({
        api: '/v4/unit/getBannerList',
        method: 'post',
        data,
	}); 
}	  

//订单支付
export const goodsOrderPay = (data) => {
    return request({
        api: '/v4/venueGoodsOrders/goodsOrderPay',
        method: 'post',
        data,
	}); 
}	     

//订单分页
export const myGoodsOrderPage = (data) => {
    return request({
        api: '/v4/venueGoodsOrders/myGoodsOrderPage',
        method: 'post',
        data,
	}); 
}		

//订单分页
export const goodsOrderDetail = (data) => {
    return request({
        api: '/v4/venueGoodsOrders/goodsOrderDetail',
        method: 'post',
        data,
	}); 
}	 

//水吧商品
export const getWaterGoodsInfo = (data) => {
    return request({
        api: '/v4/venueGoods/getWaterGoodsInfo',
        method: 'post',
        data,
	}); 
}	    

//水吧商品详情
export const goodsDetail = (data) => {
    return request({
        api: '/v4/venueGoods/goodsDetail',
        method: 'post',
        data,
	}); 
}
    
//购物车信息
export const getCarInfo = (data) => {
    return request({
        api: '/v4/waterGoodsCar/getCarInfo',
        method: 'post',
        data,
	}); 
}    

 //购物车操作(添加、减少、删除)
export const optCarInfo = (data) => {
    return request({
        api: '/v4/waterGoodsCar/optCarInfo',
        method: 'post',
        data,
	}); 
}   

 //清空购物车
export const cleanCar = (data) => {
    return request({
        api: '/v4/waterGoodsCar/cleanCar',
        method: 'post',
        data,
	}); 
}   

 //修改购物车选中
export const optSelect = (data) => {
    return request({
        api: '/v4/waterGoodsCar/optSelect',
        method: 'post',
        data,
	}); 
} 	  
	
//赠送积分
export const integralGift = (data) => {
	return request({
		api: '/v4/venueIntegralGift/integralGift',
		method: 'post',
		data,
	}); 
} 	

//查询被赠予人员
export const queryUsersEntity = (data) => {
	return request({
		api: '/v4/venueIntegralGift/queryUsersEntity',
		method: 'post',
		data,
	}); 
} 

//首页推荐课程
export const getMiniHomeClassData = (data) => {
	return request({
		api: '/v4/venueClass/getMiniHomeClassData',
		method: 'post',
		data,
	}); 
} 

//首页场馆列表
export const getMiniHomeVenue = (data) => {
	return request({
		api: '/v4/venue/getMiniHomeVenue',
		method: 'post',
		data,
	}); 
}

//私教列表
export const getPrivateTrainersList = (data) => {
	return request({
		api: '/v4/venueClass/getPrivateTrainersList',
		method: 'post',
		data,
	}); 
}

//私教详情
export const getPrivateTrainersDetail = (data) => {
	return request({
		api: '/v4/venueClass/getPrivateTrainersDetail',
		method: 'post',
		data,
	}); 
}

//私教详情
export const getTeamClassList = (data) => {
	return request({
		api: '/v4/venueClass/getTeamClassList',
		method: 'post',
		data,
	}); 
}

//团体课详情
export const getTeamClassDetail = (data) => {
	return request({
		api: '/v4/venueClass/getTeamClassDetail',
		method: 'post',
		data,
	}); 
}

//获取时段配置
export const getTimeConfigList = (data) => {
	return request({
		api: '/v4/venueClass/getTimeConfigList',
		method: 'post',
		data,
	}); 
}

//我的订单分页
export const classOrderPage = (data) => {
	return request({
		api: '/v4/venueClassOrder/classOrderPage',
		method: 'post',
		data,
	}); 
}

//订单支付
export const venueClassOrderPay = (data) => {
	return request({
		api: '/v4/venueClassOrder/pay',
		method: 'post',
		data,
	}); 
}

//获取订单最新人脸信息
export const getNewFaceImg = (data) => {
	return request({
		api: '/v4/venueClassOrder/getNewFaceImg',
		method: 'post',
		data,
	}); 
}

//私教课订单支付
export const createPOrder = (data) => {
	return request({
		api: '/v4/venueClassOrder/createPOrder',
		method: 'post',
		data,
	}); 
}

//团队订单支付
export const createTeamOrder = (data) => {
	return request({
		api: '/v4/venueClassOrder/createTeamOrder',
		method: 'post',
		data,
	}); 
}

//---------------- change中心：/v4/vip/

//获取Vip销售信息
export const vip = () => {
	return request({
		api: '/v4/vip',
		method: 'get',
	}); 
}

//购买Vip的确认信息
export const vipConfirm = (data) => {
	return request({
		api: '/v4/vip/confirm',
		method: 'get',
		data,
	}); 
}

//购买Vip创建订单
export const vipCreate = (data) => {
	return request({
		api: '/v4/vip/create',
		method: 'post',
		data,
	}); 
}

//获取vip订单是否支付成功
export const vipPay = (data) => {
	return request({
		api: '/v4/vip/pay',
		method: 'post',
		data,
	}); 
}

//获取e签宝最新申请记录
export const getChangeApplyDetail = (data) => {
	return request({
		api: '/v4/vip/getChangeApplyDetail',
		method: 'post',
		data,
	}); 
}

//创建change申请表信
export const createChangeApply = (data) => {
	return request({
		api: '/v4/vip/createChangeApply',
		method: 'post',
		data,
	}); 
}

//场馆列表
export const venueList = (data) => {
	return request({
		api: '/v4/vip/venueList',
		method: 'post',
		data,
	}); 
}

//我的场馆列表
export const myVenueOpenList = (data) => {
	return request({
		api: '/v4/vip/myVenueOpenList',
		method: 'post',
		data,
	}); 
}

//退款申提示信息
export const refundApplyMsg = (data) => {
	return request({
		api: '/v4/vip/refundApplyMsg',
		method: 'post',
		data,
	}); 
}

//退款申提示信息
export const refund = (data) => {
	return request({
		api: '/v4/vip/refund',
		method: 'post',
		data,
	}); 
}

//获取change会员信息
export const getChangeDetail = (data) => {
	return request({
		api: '/v4/vip/getChangeDetail',
		method: 'post',
		data,
	}); 
}

//获取change会员信息
export const venueOrderCreate = (data) => {
	return request({
		api: '/v4/venueOrder/create',
		method: 'post',
		data,
	}); 
}

//修改紧急联系
export const updChangeApply = (data) => {
	return request({
		api: '/v4/vip/updChangeApply',
		method: 'post',
		data,
	}); 
}

//开通场馆会员
export const openTeamVip = (data) => {
	return request({
		api: '/v4/venue/openTeamVip',
		method: 'post',
		data,
	}); 
}

//场馆列表
export const getUserVipEndAt = (data) => {
	return request({
		api: '/v4/venue/getUserVipEndAt',
		method: 'post',
		data,
	}); 
}

//查看是否开通团操课会员
export const getTeamVipEndAt = (data) => {
	return request({
		api: '/v4/venue/getTeamVipEndAt',
		method: 'post',
		data,
	}); 
}
